using INTEX.DataBase;
using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
using System.Collections.Generic;
namespace WPFExcelReport
{
    public partial class VBASTGA : ViewModelBase
    {
        VWTSAER _VWT;
        public VWTSAER VWT
        {
            get
            {
                if (_VWT == null) _VWT = new VWTSAER();
                return _VWT;
            }
        }
        VGSDAT _VGS;
        public VGSDAT VGS
        {
            get
            {
                if (_VGS == null) _VGS = new VGSDAT();
                return _VGS;
            }
        }
        public DataSet LOADBYWS(Dictionary<string, object> pm)
        {
            dwData = TBMain.NewRow();
            dwData["BAGMANDANT"] = app.Mandant;
            dwData["BAGART"] = pm["ART"].ToString();
            dwData["BAGVAR"] = pm["VAR"].ToString().Trim().PadRight(2);
            dwData["BAGFARBE"] = pm["FARBE"].ToString();
            SResult =QBGA03(dwData);
            return SResult;
        }
        public DataSet CREATEBYWS(Dictionary<string, object> pm)
        {
            dwData = TBMain.NewRow();
            SetUpNewRow(ref dwData);
            dwData["BAGMANDANT"] = app.Mandant;
            dwData["BAGART"] = pm["ART"].ToString();
            dwData["BAGVAR"] = pm["VAR"].ToString();
            dwData["BAGFARBE"] = pm["FARBE"].ToString();
            TBMain.Rows.InsertAt(dwData, 0);
            InsertBASTGA(dwData);
            return SResult;
        }
        public virtual void Copy(Dictionary<string, object> pm)
        {
            string tart = (string)pm["TART"];
            string sart = (string)pm["SART"];
            dwData = TBMain.NewRow();
            dwData["BAGMANDANT"] = app.Mandant;
            dwData["BAGART"] = sart.PadRight(20);
            SResult = QBGA06(dwData);
            foreach (DataRow dwSrc in SResult.Tables[0].Rows)
            {
                dwData = TBMain.NewRow();
                dwData.ItemArray = dwSrc.ItemArray;
                dwData["BAGART"] = tart.PadRight(20);
                TBMain.Rows.InsertAt(dwData, 0);
                DBG01(dwData);
                InsertBASTGA(dwData);
            }
        }
    }
    public partial class VBASTGA
    {
        public string BAGART { get { if (dwMaster == null) return ""; return dwMaster["BAGART"].ToString(); } set { if (dwMaster == null) return; dwMaster["BAGART"] = value; OnPropertyChanged("BAGART", value); } } //lENGth 20
        public string BAGVAR { get { if (dwMaster == null) return ""; return dwMaster["BAGVAR"].ToString(); } set { if (dwMaster == null) return; dwMaster["BAGVAR"] = value; OnPropertyChanged("BAGVAR", value); } } //lENGth 2
        public string BAGFARBE { get { if (dwMaster == null) return ""; return dwMaster["BAGFARBE"].ToString(); } set { if (dwMaster == null) return; dwMaster["BAGFARBE"] = value; OnPropertyChanged("BAGFARBE", value); } } //lENGth 10
        public string BAGPOS { get { if (dwMaster == null) return ""; return dwMaster["BAGPOS"].ToString(); } set { if (dwMaster == null) return; dwMaster["BAGPOS"] = value; OnPropertyChanged("BAGPOS", value); } } //lENGth 2
        public string BAGGART { get { if (dwMaster == null) return ""; return dwMaster["BAGGART"].ToString(); } set { if (dwMaster == null) return; dwMaster["BAGGART"] = value; OnPropertyChanged("BAGGART", value); } } //lENGth 20
        public string BAGGVAR { get { if (dwMaster == null) return ""; return dwMaster["BAGGVAR"].ToString(); } set { if (dwMaster == null) return; dwMaster["BAGGVAR"] = value; OnPropertyChanged("BAGGVAR", value); } } //lENGth 3
        public string BAGGFARBE { get { if (dwMaster == null) return ""; return dwMaster["BAGGFARBE"].ToString(); } set { if (dwMaster == null) return; dwMaster["BAGGFARBE"] = value; OnPropertyChanged("BAGGFARBE", value); } } //lENGth 10
        public double BAGFDZ { get { if (dwMaster == null) return 0.0; return Convert.ToDouble(dwMaster["BAGFDZ"].ToString()); } set { if (dwMaster == null) return; dwMaster["BAGFDZ"] = value; OnPropertyChanged("BAGFDZ", value); } } //lENGth 0
        public double BAGABF { get { if (dwMaster == null) return 0.0; return Convert.ToDouble(dwMaster["BAGABF"].ToString()); } set { if (dwMaster == null) return; dwMaster["BAGABF"] = value; OnPropertyChanged("BAGABF", value); } } //lENGth 0
        public double BAGKGNET { get { if (dwMaster == null) return 0.0; return Convert.ToDouble(dwMaster["BAGKGNET"].ToString()); } set { if (dwMaster == null) return; dwMaster["BAGKGNET"] = value; OnPropertyChanged("BAGKGNET", value); } } //lENGth 0
        public double BAGKGBRUT { get { if (dwMaster == null) return 0.0; return Convert.ToDouble(dwMaster["BAGKGBRUT"].ToString()); } set { if (dwMaster == null) return; dwMaster["BAGKGBRUT"] = value; OnPropertyChanged("BAGKGBRUT", value); } } //lENGth 0
        public string BAGDISPOKZ { get { if (dwMaster == null) return ""; return dwMaster["BAGDISPOKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["BAGDISPOKZ"] = value; OnPropertyChanged("BAGDISPOKZ", value); } } //lENGth 1
        public string BAGBEM { get { if (dwMaster == null) return ""; return dwMaster["BAGBEM"].ToString(); } set { if (dwMaster == null) return; dwMaster["BAGBEM"] = value; OnPropertyChanged("BAGBEM", value); } } //lENGth 20
        public string BAGVARKZ { get { if (dwMaster == null) return ""; return dwMaster["BAGVARKZ"].ToString(); } set { if (dwMaster == null) return; dwMaster["BAGVARKZ"] = value; OnPropertyChanged("BAGVARKZ", value); } } //lENGth 1
        public string BAGAUFMSL { get { if (dwMaster == null) return ""; return dwMaster["BAGAUFMSL"].ToString(); } set { if (dwMaster == null) return; dwMaster["BAGAUFMSL"] = value; OnPropertyChanged("BAGAUFMSL", value); } } //lENGth 2
        public string BAGFILLER { get { if (dwMaster == null) return ""; return dwMaster["BAGFILLER"].ToString(); } set { if (dwMaster == null) return; dwMaster["BAGFILLER"] = value; OnPropertyChanged("BAGFILLER", value); } } //lENGth 18
 
    }
}
